package oralExamSchedulingSystem;

public class Time {
        private int _StartTime;
        private int _duration;
        
        public Time(int startTime,int duration){
                this._StartTime=startTime;
                this._duration=duration;
        }
        
        public boolean isCollideWith(Time that_time){
        if(that_time._StartTime>this._StartTime && that_time._StartTime <= this._StartTime+this._duration)
            return true;
        if(that_time._StartTime+that_time._duration>=this._StartTime && that_time._StartTime+that_time._duration < this._StartTime+this._duration)
            return true;
        return false;
        }
        
        public String toString(){
                String time_str="";
        int hour = _StartTime/60;
        int minute = _StartTime%60;
        time_str=hour+":";
        if(minute<10)
                time_str+="0";
        time_str+=minute;
        return time_str;
        }
        
        public Time getthis(){
                return this;
        }
}